﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Agenda.Repositories;
using Agenda.Entities;
using System.Data.OleDb;

namespace Agenda.Service
{
    public class SpoutService
    {
        public void Add(Spout spout)
        {
            Credentials.currentObra = new ObraRepository().Get(spout.obraId);
            spout.obraId = Credentials.currentObra.obraId;
            new SpoutRepository().Add(spout);
        }

        public Spout Get(int Id)
        {
            return new SpoutRepository().Get(Id);
        }

        public List<Spout> ListBy(DBObjects.Spout field, string q)
        {
            return new SpoutRepository().ListBy(field, q);
        }

        public void Update(Spout sp)
        {
            new SpoutRepository().Update(sp);
        }
    }
}
